<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="../node_modules/jquery/dist/jquery.js"></script>
    <script>
        $(() => {
            var contItems = $('#contentView div')
            $('#btns input').click(function () {

                $(this).addClass('cunrrentTip').siblings().removeClass('cunrrentTip')
                let contentItem = contItems.eq($(this).index())
                contentItem.addClass('active').siblings().removeClass('active')

            })
        })

    </script>
    <style>
        body {
            display: flex;
            flex-direction: column;
        }

        .tips input {
            width: 150px;
            height: 50px;
            margin-right: 10px;
            background-color: gray;
            color: aliceblue;
            text-align: center;
            border: 0;
        }

        .tips .cunrrentTip {
            background-color: rgb(244, 176, 6);
        }

        .cons div {
            width: 500px;
            height: 400px;
            left: 0px;
            display: none;
            background-color: rgb(244, 176, 6);
        }

        .cons .active {
            display: block;
        }
    </style>
</head>

<body style="display: flex">


    <div id="btns" class="tips">
        <input type="button" name="" id="btn1" class="cunrrentTip" value="新闻">
        <input type="button" name="" id="btn2" value="娱乐">
        <input type="button" name="" id="btn3" value="音乐">
    </div>
    <div id="contentView" class="cons">
        <div class="active">1</div>
        <div>2</div>
        <div>3</div>

    </div>

</body>

</html>